/* 段落版本对比样式 */

.version-comparison {
  padding: 16px;
}

/* 控制面板 */
.compare-controls {
  margin-bottom: 16px;
  background: #fafafa;
}

/* 版本卡片 */
.version-card {
  transition: all 0.3s;
  border: 2px solid transparent;
  height: 100%;
}

.version-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.version-card.selected {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 内容区域 */
.version-content {
  min-height: 150px;
  margin-bottom: 16px;
}

.content-text {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  margin: 0;
}

.generating-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: #999;
}

.generating-placeholder span {
  margin-top: 8px;
}

.error-message {
  color: #ff4d4f;
  padding: 16px;
  background: #fff2f0;
  border-radius: 4px;
}

/* 指标显示 */
.version-metrics {
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.metric-item {
  margin-bottom: 8px;
}

.metric-label {
  font-size: 12px;
  color: #666;
  display: block;
  margin-bottom: 4px;
}

/* 自定义进度条 */
.progress-bar {
  position: relative;
  width: 100%;
  height: 20px;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s;
}

.progress-value {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #333;
  font-weight: 500;
}

/* 版本统计 */
.version-stats {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e8e8e8;
  font-size: 13px;
  color: #666;
}

/* 差异视图 */
.diff-view {
  position: relative;
}

.diff-stats {
  margin-top: 16px;
  background: #f5f7fa;
  text-align: center;
}

.diff-stats span {
  margin: 0 12px;
  font-size: 14px;
}

/* 叠加视图 */
.overlay-view {
  max-width: 800px;
  margin: 0 auto;
}

.overlay-view .ant-slider {
  margin: 24px 16px 32px;
}

.overlay-view .ant-slider-mark-text {
  font-size: 12px;
}

/* 高亮差异 */
mark {
  padding: 2px 4px;
  border-radius: 3px;
  background-color: #52c41a20 !important;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.version-card {
  animation: fadeIn 0.3s ease;
}

/* 响应式布局 */
@media (max-width: 1200px) {
  .version-comparison {
    padding: 8px;
  }

  .version-card .ant-card-head-title {
    font-size: 14px;
  }

  .content-text {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .compare-controls .ant-space {
    display: block;
  }

  .compare-controls .ant-space > * {
    display: block;
    margin-bottom: 8px;
  }

  .diff-view .ant-col {
    margin-bottom: 16px;
  }

  .version-metrics .ant-row {
    margin: 0 !important;
  }

  .version-metrics .ant-col {
    padding: 4px !important;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .version-comparison {
    background: #1f1f1f;
  }

  .compare-controls {
    background: #2a2a2a;
  }

  .version-card {
    background: #2a2a2a;
    border-color: #434343;
  }

  .version-card.selected {
    border-color: #177ddc;
    box-shadow: 0 0 0 3px rgba(23, 125, 220, 0.2);
  }

  .content-text {
    color: #e8e8e8;
  }

  .version-metrics {
    border-top-color: #434343;
  }

  .version-stats {
    border-top-color: #434343;
    color: #b8b8b8;
  }

  .progress-bar {
    background: #3a3a3a;
  }

  .progress-value {
    color: #e8e8e8;
  }

  .diff-stats {
    background: #2a2a2a;
  }

  mark {
    background-color: #177ddc30 !important;
    color: #e8e8e8;
  }
}

/* 打印优化 */
@media print {
  .compare-controls {
    display: none;
  }

  .version-card {
    page-break-inside: avoid;
    border: 1px solid #000 !important;
    margin-bottom: 20px;
  }

  .version-card.selected {
    border-width: 2px !important;
  }
}